package com.wang.designpattern.proxy.cglib;


public class Client {

    public static void main(String[] args) {
        // 1、创建目标对象
        TeacherDao target = new TeacherDao();

        // 2、创建代理对象
        TeacherDao proxyInstance = (TeacherDao) new ProxyFactory(target).getProxyInstance();

        // 3、class com.wang.designpattern.proxy.cglib.TeacherDao$$EnhancerByCGLIB$$4036fb41
        System.out.println(proxyInstance.getClass());

        // 4、执行方法
        proxyInstance.teach();
    }
}
